<template>
    <div>
        <table>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <td :class="{aa:index==1}"></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
        </table> 
        <p>
            <button @click="frist_page()">首页</button>
            <button @click="up_page()">上一页</button>
            <button v-for="p in page_list" :key="p" @click="get_page(p)">{{p}}</button>
            <button @click="down_page()">下一页</button>
            <button @click="last_page()">尾页</button>    
        </p>   
    </div>    
</template>

<script>
export default {
    name:"showbook2",
    data() {
        return {
            page_list:[],
            all_page:"",
            p:1,
        }
    },
    methods:{
        frist_page(){
            this.p = 1
            this.show()
        },
        last_page(){
            this.p = this.all_page
            this.show()
        },
        up_page(){
            if(this.p==1){
                this.show()
            }else{
                this.p>1
                this.p-=1
                this.show
            }
        },
        down_page(){
            if (this.p=this.all_page){
                this.show
            }else{
                this.p+=1
                this.show()
            }
        },
        get_page(p){
            this.p=p
            this.show()
        }
    }
}
</script>

<style>

</style>
